home *** CD-ROM | disk | FTP | other *** search
/ Adventures with Oslo: Tools & Gadgets / Adventures with Oslo - Tools and Gadgets.ISO / mac / Ad / Mod04 / Shop / crosmath.Dir / 00031.ls < prev    next >
Encoding:
Text File  |  1994-09-23  |  1.9 KB  |  57 lines

  1. on startMovie
  2.   global selectedSprite
  3.   set HC to the number of cast "handCursor"
  4.   cursor([HC, HC + 1])
  5.   set selectedSprite to 0
  6.   put field "startState" into field "currentState"
  7. end
  8.  
  9. on selectNewNum
  10.   global selectedSprite
  11.   set the foreColor of sprite selectedSprite to 255
  12.   set the foreColor of sprite the clickOn to 71
  13.   set selectedSprite to the clickOn
  14.   puppetSound(the name of cast (the number of cast "won" + the clickOn - 12))
  15.   updateStage()
  16. end
  17.  
  18. on moveNumToSquare
  19.   global selectedSprite
  20.   if the castNum of sprite the clickOn = the number of cast "blank square" then
  21.     if selectedSprite <> 0 then
  22.       set selectedNum to selectedSprite - 11
  23.       set the castNum of sprite the clickOn to the number of cast "one" + selectedNum - 1
  24.       set the foreColor of sprite selectedSprite to 255
  25.       set the castNum of sprite selectedSprite to the number of cast "blank square"
  26.       set selectedSprite to 0
  27.       puppetSound("Poper.S")
  28.       updateStage()
  29.       set itemNum to (the clickOn mod 3) + 1
  30.       set lineNum to the clickOn / 3
  31.       put selectedNum into item itemNum of line lineNum of field "currentState"
  32.       if field "currentState" = field "solution" then
  33.         puppetSound("Ta Dah!.S")
  34.         updateStage()
  35.         continue()
  36.       end if
  37.     end if
  38.   else
  39.     set whichNum to the castNum of sprite the clickOn - the number of cast "one" + 1
  40.     set the castNum of sprite (11 + whichNum) to the number of cast "one" + whichNum - 1
  41.     set the castNum of sprite the clickOn to the number of cast "blank square"
  42.     set the foreColor of sprite selectedSprite to 255
  43.     set the foreColor of sprite (11 + whichNum) to 71
  44.     set selectedSprite to 11 + whichNum
  45.     puppetSound("Beebit.S")
  46.     updateStage()
  47.     set itemNum to ((the clickOn - 3) mod 3) + 1
  48.     set lineNum to ((the clickOn - 3) / 3) + 1
  49.     put 0 into item itemNum of line lineNum of field "currentState"
  50.   end if
  51. end
  52.  
  53. on enterFrame
  54.   puppetSound("Nice Pling.S")
  55.   updateStage()
  56. end
  57.